package com.bcu.cn.onlineexamsystem.exammanage.mapper;

import com.bcu.cn.onlineexamsystem.exammanage.entity.Course;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface CourseMapper {
    @Select("SELECT c.*, tc.teacher_id as teacherId FROM courses c " +
            "INNER JOIN teacher_courses tc ON c.course_id = tc.course_id " +
            "WHERE tc.teacher_id = #{teacherId}")
    List<Course> findByTeacherId(String teacherId);

    @Select("SELECT * FROM courses")
    List<Course> findAll();
} 